﻿#include <chrono>

struct Gimer {
	std::chrono::time_point<std::chrono::high_resolution_clock> start, end;

	//构造函数构造一个启动计时器
	Gimer() {
		start = std::chrono::high_resolution_clock::now();
	}

	~Gimer() {
		end = std::chrono::high_resolution_clock::now();
		auto duration = std::chrono::duration_cast<std::chrono::microseconds>(end - start);
		std::cout << "Gimer: " << duration.count() << " ms\n";
	}
};
